package com.tank.nio;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

/**
 * Created with IntelliJ IDEA.
 * User: SuQiEr
 * Date:2017/7/30 0030
 * Time: 下午 4:12
 * To change this template use File | Settings | File Templates.
 */
public class ObjectOutputStreamTest {

    public static void main(String[] args) throws IOException {

        Person person = new Person("tank",18);
        FileOutputStream fos = new FileOutputStream("person.txt");
        ObjectOutputStream out = new ObjectOutputStream(fos);

        out.writeObject(person);
        out.flush();
        out.close();



    }


}
